/*  (c) 2008 Benjamin Schroeter
 *  This file is part of JaDAL - Just another DSL-Tools Addon Library
 *  and licensed under the New BSD License
 *  For more information please visit http://www.codeplex.com/JaDAL */
using System;

namespace BenjaminSchroeter.Dsl.UserRestrictions
{
    /// <summary>
    /// Restrict the merging of two elements.
    /// </summary>
    /// <remarks>To use with the domain classes</remarks>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
    public class RestrictElementMergeAttribute : Attribute
    {
        /// <summary>
        /// Gets or sets the restriction mode this setting is used for.
        /// </summary>
        /// <value>The restriction mode this setting is used for.</value>
        public int RestrictionMode { get; private set; }

        /// <summary>
        /// Gets or sets the element.
        /// </summary>
        /// <value>The element.</value>
        public string Element { get; private set; }
        
        /// <summary>
        /// Gets or sets a value indicating whether the addition of this element should be restricted.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if the addition of this element items is restricted; otherwise, <c>false</c>.
        /// </value>
        public bool IsRestricted { get; private set;}

        /// <summary>
        /// Initializes a new instance of the <see cref="RestrictElementMergeAttribute"/> class.
        /// </summary>
        /// <param name="restrictionMode">The restriction mode.</param>
        /// <param name="compartment">The element name.</param>
        /// <param name="isRestricted">if set to <c>true</c> addition of the given element is not allowd in this restriction mode.</param>
        public RestrictElementMergeAttribute(int restrictionMode, string compartment, bool isRestricted)
        {
            this.Element = compartment;
            this.IsRestricted = isRestricted;
            this.RestrictionMode = restrictionMode;
        }
    }
}